
package com.sausageking.shared;

import java.io.Serializable;

import javax.persistence.Id;

import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

@Unindexed
public class Consumer implements Serializable {

  private static final long serialVersionUID = -1179372982688055299L;

  @Id
  @Indexed
  private String email;

  private String password;

  private String passwordHash;
  
  private String accessToken;
  
  public Consumer() {
  }

  public Consumer(String email, String passwordHash) {
    this.email = email;
    this.passwordHash = passwordHash;
  }


  public String getEmail() {
    return email;
  }

  public Consumer setEmail(String email) {
    this.email = email;
    return this;
  }
  
  public static long getSerialversionuid() {
    return serialVersionUID;
  }

  public String toString() {
    ToStringHelper helper = Objects.toStringHelper(this)
        .add("email", email).add("haspassword", password != null);
    return helper.toString();
  }

  public String getAccessToken() {
    return accessToken;
  }

  public void setAccessToken(String accessToken) {
    this.accessToken = accessToken;
  }

  public String getPassword() {
    return password;
  }

  public Consumer setPassword(String password) {
    this.password = password;
    return this;
  }
}
